\(\int \sec ^3(c+d x) (a+b \sec (c+d x))^2 (A+B \sec (c+d x)) \, dx\) [285]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [F]
   Maxima [A] (verification not implemented)
   Giac [B] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 31, antiderivative size = 198 \[ \int \sec ^3(c+d x) (a+b \sec (c+d x))^2 (A+B \sec (c+d x)) \, dx=\frac {\left (4 a^2 A+3 A b^2+6 a b B\right ) \text {arctanh}(\sin (c+d x))}{8 d}+\frac {\left (4 b^2 B+5 a (2 A b+a B)\right ) \tan (c+d x)}{5 d}+\frac {\left (4 a^2 A+3 A b^2+6 a b B\right ) \sec (c+d x) \tan (c+d x)}{8 d}+\frac {b (5 A b+6 a B) \sec ^3(c+d x) \tan (c+d x)}{20 d}+\frac {b B \sec ^3(c+d x) (a+b \sec (c+d x)) \tan (c+d x)}{5 d}+\frac {\left (4 b^2 B+5 a (2 A b+a B)\right ) \tan ^3(c+d x)}{15 d} \]

[Out]

1/8*(4*A*a^2+3*A*b^2+6*B*a*b)*arctanh(sin(d*x+c))/d+1/5*(4*b^2*B+5*a*(2*A*b+B*a))*tan(d*x+c)/d+1/8*(4*A*a^2+3*
A*b^2+6*B*a*b)*sec(d*x+c)*tan(d*x+c)/d+1/20*b*(5*A*b+6*B*a)*sec(d*x+c)^3*tan(d*x+c)/d+1/5*b*B*sec(d*x+c)^3*(a+
b*sec(d*x+c))*tan(d*x+c)/d+1/15*(4*b^2*B+5*a*(2*A*b+B*a))*tan(d*x+c)^3/d

Rubi [A] (verified)

Time = 0.31 (sec) , antiderivative size = 198, normalized size of antiderivative = 1.00, number of steps used = 7, number of rules used = 6, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.194, Rules used = {4111, 4132, 3852, 4131, 3853, 3855} \[ \int \sec ^3(c+d x) (a+b \sec (c+d x))^2 (A+B \sec (c+d x)) \, dx=\frac {\left (4 a^2 A+6 a b B+3 A b^2\right ) \text {arctanh}(\sin (c+d x))}{8 d}+\frac {\left (4 a^2 A+6 a b B+3 A b^2\right ) \tan (c+d x) \sec (c+d x)}{8 d}+\frac {\left (5 a (a B+2 A b)+4 b^2 B\right ) \tan ^3(c+d x)}{15 d}+\frac {\left (5 a (a B+2 A b)+4 b^2 B\right ) \tan (c+d x)}{5 d}+\frac {b (6 a B+5 A b) \tan (c+d x) \sec ^3(c+d x)}{20 d}+\frac {b B \tan (c+d x) \sec ^3(c+d x) (a+b \sec (c+d x))}{5 d} \]

[In]

Int[Sec[c + d*x]^3*(a + b*Sec[c + d*x])^2*(A + B*Sec[c + d*x]),x]

[Out]

((4*a^2*A + 3*A*b^2 + 6*a*b*B)*ArcTanh[Sin[c + d*x]])/(8*d) + ((4*b^2*B + 5*a*(2*A*b + a*B))*Tan[c + d*x])/(5*
d) + ((4*a^2*A + 3*A*b^2 + 6*a*b*B)*Sec[c + d*x]*Tan[c + d*x])/(8*d) + (b*(5*A*b + 6*a*B)*Sec[c + d*x]^3*Tan[c
 + d*x])/(20*d) + (b*B*Sec[c + d*x]^3*(a + b*Sec[c + d*x])*Tan[c + d*x])/(5*d) + ((4*b^2*B + 5*a*(2*A*b + a*B)
)*Tan[c + d*x]^3)/(15*d)

Rule 3852

Int[csc[(c_.) + (d_.)*(x_)]^(n_), x_Symbol] :> Dist[-d^(-1), Subst[Int[ExpandIntegrand[(1 + x^2)^(n/2 - 1), x]
, x], x, Cot[c + d*x]], x] /; FreeQ[{c, d}, x] && IGtQ[n/2, 0]

Rule 3853

Int[(csc[(c_.) + (d_.)*(x_)]*(b_.))^(n_), x_Symbol] :> Simp[(-b)*Cos[c + d*x]*((b*Csc[c + d*x])^(n - 1)/(d*(n
- 1))), x] + Dist[b^2*((n - 2)/(n - 1)), Int[(b*Csc[c + d*x])^(n - 2), x], x] /; FreeQ[{b, c, d}, x] && GtQ[n,
 1] && IntegerQ[2*n]

Rule 3855

Int[csc[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[-ArcTanh[Cos[c + d*x]]/d, x] /; FreeQ[{c, d}, x]

Rule 4111

Int[(csc[(e_.) + (f_.)*(x_)]*(d_.))^(n_)*(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_))^(m_)*(csc[(e_.) + (f_.)*(x_)]*
(B_.) + (A_)), x_Symbol] :> Simp[(-b)*B*Cot[e + f*x]*(a + b*Csc[e + f*x])^(m - 1)*((d*Csc[e + f*x])^n/(f*(m +
n))), x] + Dist[1/(m + n), Int[(a + b*Csc[e + f*x])^(m - 2)*(d*Csc[e + f*x])^n*Simp[a^2*A*(m + n) + a*b*B*n +
(a*(2*A*b + a*B)*(m + n) + b^2*B*(m + n - 1))*Csc[e + f*x] + b*(A*b*(m + n) + a*B*(2*m + n - 1))*Csc[e + f*x]^
2, x], x], x] /; FreeQ[{a, b, d, e, f, A, B, n}, x] && NeQ[A*b - a*B, 0] && NeQ[a^2 - b^2, 0] && GtQ[m, 1] &&
 !(IGtQ[n, 1] &&  !IntegerQ[m])

Rule 4131

Int[(csc[(e_.) + (f_.)*(x_)]*(b_.))^(m_.)*(csc[(e_.) + (f_.)*(x_)]^2*(C_.) + (A_)), x_Symbol] :> Simp[(-C)*Cot
[e + f*x]*((b*Csc[e + f*x])^m/(f*(m + 1))), x] + Dist[(C*m + A*(m + 1))/(m + 1), Int[(b*Csc[e + f*x])^m, x], x
] /; FreeQ[{b, e, f, A, C, m}, x] && NeQ[C*m + A*(m + 1), 0] &&  !LeQ[m, -1]

Rule 4132

Int[(csc[(e_.) + (f_.)*(x_)]*(b_.))^(m_.)*((A_.) + csc[(e_.) + (f_.)*(x_)]*(B_.) + csc[(e_.) + (f_.)*(x_)]^2*(
C_.)), x_Symbol] :> Dist[B/b, Int[(b*Csc[e + f*x])^(m + 1), x], x] + Int[(b*Csc[e + f*x])^m*(A + C*Csc[e + f*x
]^2), x] /; FreeQ[{b, e, f, A, B, C, m}, x]

Rubi steps \begin{align*} \text {integral}& = \frac {b B \sec ^3(c+d x) (a+b \sec (c+d x)) \tan (c+d x)}{5 d}+\frac {1}{5} \int \sec ^3(c+d x) \left (a (5 a A+3 b B)+\left (4 b^2 B+5 a (2 A b+a B)\right ) \sec (c+d x)+b (5 A b+6 a B) \sec ^2(c+d x)\right ) \, dx \\ & = \frac {b B \sec ^3(c+d x) (a+b \sec (c+d x)) \tan (c+d x)}{5 d}+\frac {1}{5} \int \sec ^3(c+d x) \left (a (5 a A+3 b B)+b (5 A b+6 a B) \sec ^2(c+d x)\right ) \, dx+\frac {1}{5} \left (4 b^2 B+5 a (2 A b+a B)\right ) \int \sec ^4(c+d x) \, dx \\ & = \frac {b (5 A b+6 a B) \sec ^3(c+d x) \tan (c+d x)}{20 d}+\frac {b B \sec ^3(c+d x) (a+b \sec (c+d x)) \tan (c+d x)}{5 d}+\frac {1}{4} \left (4 a^2 A+3 A b^2+6 a b B\right ) \int \sec ^3(c+d x) \, dx-\frac {\left (4 b^2 B+5 a (2 A b+a B)\right ) \text {Subst}\left (\int \left (1+x^2\right ) \, dx,x,-\tan (c+d x)\right )}{5 d} \\ & = \frac {\left (4 b^2 B+5 a (2 A b+a B)\right ) \tan (c+d x)}{5 d}+\frac {\left (4 a^2 A+3 A b^2+6 a b B\right ) \sec (c+d x) \tan (c+d x)}{8 d}+\frac {b (5 A b+6 a B) \sec ^3(c+d x) \tan (c+d x)}{20 d}+\frac {b B \sec ^3(c+d x) (a+b \sec (c+d x)) \tan (c+d x)}{5 d}+\frac {\left (4 b^2 B+5 a (2 A b+a B)\right ) \tan ^3(c+d x)}{15 d}+\frac {1}{8} \left (4 a^2 A+3 A b^2+6 a b B\right ) \int \sec (c+d x) \, dx \\ & = \frac {\left (4 a^2 A+3 A b^2+6 a b B\right ) \text {arctanh}(\sin (c+d x))}{8 d}+\frac {\left (4 b^2 B+5 a (2 A b+a B)\right ) \tan (c+d x)}{5 d}+\frac {\left (4 a^2 A+3 A b^2+6 a b B\right ) \sec (c+d x) \tan (c+d x)}{8 d}+\frac {b (5 A b+6 a B) \sec ^3(c+d x) \tan (c+d x)}{20 d}+\frac {b B \sec ^3(c+d x) (a+b \sec (c+d x)) \tan (c+d x)}{5 d}+\frac {\left (4 b^2 B+5 a (2 A b+a B)\right ) \tan ^3(c+d x)}{15 d} \\ \end{align*}

Mathematica [A] (verified)

Time = 1.04 (sec) , antiderivative size = 150, normalized size of antiderivative = 0.76 \[ \int \sec ^3(c+d x) (a+b \sec (c+d x))^2 (A+B \sec (c+d x)) \, dx=\frac {15 \left (4 a^2 A+3 A b^2+6 a b B\right ) \text {arctanh}(\sin (c+d x))+\tan (c+d x) \left (15 \left (4 a^2 A+3 A b^2+6 a b B\right ) \sec (c+d x)+30 b (A b+2 a B) \sec ^3(c+d x)+8 \left (15 \left (2 a A b+a^2 B+b^2 B\right )+5 \left (2 a A b+a^2 B+2 b^2 B\right ) \tan ^2(c+d x)+3 b^2 B \tan ^4(c+d x)\right )\right )}{120 d} \]

[In]

Integrate[Sec[c + d*x]^3*(a + b*Sec[c + d*x])^2*(A + B*Sec[c + d*x]),x]

[Out]

(15*(4*a^2*A + 3*A*b^2 + 6*a*b*B)*ArcTanh[Sin[c + d*x]] + Tan[c + d*x]*(15*(4*a^2*A + 3*A*b^2 + 6*a*b*B)*Sec[c
 + d*x] + 30*b*(A*b + 2*a*B)*Sec[c + d*x]^3 + 8*(15*(2*a*A*b + a^2*B + b^2*B) + 5*(2*a*A*b + a^2*B + 2*b^2*B)*
Tan[c + d*x]^2 + 3*b^2*B*Tan[c + d*x]^4)))/(120*d)

Maple [A] (verified)

Time = 5.45 (sec) , antiderivative size = 171, normalized size of antiderivative = 0.86

method result size
parts \(\frac {\left (A \,b^{2}+2 B a b \right ) \left (-\left (-\frac {\sec \left (d x +c \right )^{3}}{4}-\frac {3 \sec \left (d x +c \right )}{8}\right ) \tan \left (d x +c \right )+\frac {3 \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{8}\right )}{d}-\frac {\left (2 A a b +B \,a^{2}\right ) \left (-\frac {2}{3}-\frac {\sec \left (d x +c \right )^{2}}{3}\right ) \tan \left (d x +c \right )}{d}+\frac {A \,a^{2} \left (\frac {\sec \left (d x +c \right ) \tan \left (d x +c \right )}{2}+\frac {\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{2}\right )}{d}-\frac {b^{2} B \left (-\frac {8}{15}-\frac {\sec \left (d x +c \right )^{4}}{5}-\frac {4 \sec \left (d x +c \right )^{2}}{15}\right ) \tan \left (d x +c \right )}{d}\) \(171\)
derivativedivides \(\frac {A \,a^{2} \left (\frac {\sec \left (d x +c \right ) \tan \left (d x +c \right )}{2}+\frac {\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{2}\right )-B \,a^{2} \left (-\frac {2}{3}-\frac {\sec \left (d x +c \right )^{2}}{3}\right ) \tan \left (d x +c \right )-2 A a b \left (-\frac {2}{3}-\frac {\sec \left (d x +c \right )^{2}}{3}\right ) \tan \left (d x +c \right )+2 B a b \left (-\left (-\frac {\sec \left (d x +c \right )^{3}}{4}-\frac {3 \sec \left (d x +c \right )}{8}\right ) \tan \left (d x +c \right )+\frac {3 \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{8}\right )+A \,b^{2} \left (-\left (-\frac {\sec \left (d x +c \right )^{3}}{4}-\frac {3 \sec \left (d x +c \right )}{8}\right ) \tan \left (d x +c \right )+\frac {3 \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{8}\right )-b^{2} B \left (-\frac {8}{15}-\frac {\sec \left (d x +c \right )^{4}}{5}-\frac {4 \sec \left (d x +c \right )^{2}}{15}\right ) \tan \left (d x +c \right )}{d}\) \(221\)
default \(\frac {A \,a^{2} \left (\frac {\sec \left (d x +c \right ) \tan \left (d x +c \right )}{2}+\frac {\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{2}\right )-B \,a^{2} \left (-\frac {2}{3}-\frac {\sec \left (d x +c \right )^{2}}{3}\right ) \tan \left (d x +c \right )-2 A a b \left (-\frac {2}{3}-\frac {\sec \left (d x +c \right )^{2}}{3}\right ) \tan \left (d x +c \right )+2 B a b \left (-\left (-\frac {\sec \left (d x +c \right )^{3}}{4}-\frac {3 \sec \left (d x +c \right )}{8}\right ) \tan \left (d x +c \right )+\frac {3 \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{8}\right )+A \,b^{2} \left (-\left (-\frac {\sec \left (d x +c \right )^{3}}{4}-\frac {3 \sec \left (d x +c \right )}{8}\right ) \tan \left (d x +c \right )+\frac {3 \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{8}\right )-b^{2} B \left (-\frac {8}{15}-\frac {\sec \left (d x +c \right )^{4}}{5}-\frac {4 \sec \left (d x +c \right )^{2}}{15}\right ) \tan \left (d x +c \right )}{d}\) \(221\)
parallelrisch \(\frac {-60 \left (\cos \left (5 d x +5 c \right )+5 \cos \left (3 d x +3 c \right )+10 \cos \left (d x +c \right )\right ) \left (A \,a^{2}+\frac {3}{4} A \,b^{2}+\frac {3}{2} B a b \right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )+60 \left (\cos \left (5 d x +5 c \right )+5 \cos \left (3 d x +3 c \right )+10 \cos \left (d x +c \right )\right ) \left (A \,a^{2}+\frac {3}{4} A \,b^{2}+\frac {3}{2} B a b \right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )+\left (240 A \,a^{2}+420 A \,b^{2}+840 B a b \right ) \sin \left (2 d x +2 c \right )+\left (800 A a b +400 B \,a^{2}+320 b^{2} B \right ) \sin \left (3 d x +3 c \right )+\left (120 A \,a^{2}+90 A \,b^{2}+180 B a b \right ) \sin \left (4 d x +4 c \right )+\left (160 A a b +80 B \,a^{2}+64 b^{2} B \right ) \sin \left (5 d x +5 c \right )+640 \left (A a b +\frac {1}{2} B \,a^{2}+b^{2} B \right ) \sin \left (d x +c \right )}{120 d \left (\cos \left (5 d x +5 c \right )+5 \cos \left (3 d x +3 c \right )+10 \cos \left (d x +c \right )\right )}\) \(294\)
norman \(\frac {-\frac {4 \left (50 A a b +25 B \,a^{2}+29 b^{2} B \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{5}}{15 d}+\frac {\left (4 A \,a^{2}-16 A a b +5 A \,b^{2}-8 B \,a^{2}+10 B a b -8 b^{2} B \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{9}}{4 d}-\frac {\left (4 A \,a^{2}+16 A a b +5 A \,b^{2}+8 B \,a^{2}+10 B a b +8 b^{2} B \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{4 d}-\frac {\left (12 A \,a^{2}-64 A a b +3 A \,b^{2}-32 B \,a^{2}+6 B a b -16 b^{2} B \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{7}}{6 d}+\frac {\left (12 A \,a^{2}+64 A a b +3 A \,b^{2}+32 B \,a^{2}+6 B a b +16 b^{2} B \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{3}}{6 d}}{\left (-1+\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}\right )^{5}}-\frac {\left (4 A \,a^{2}+3 A \,b^{2}+6 B a b \right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}{8 d}+\frac {\left (4 A \,a^{2}+3 A \,b^{2}+6 B a b \right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}{8 d}\) \(325\)
risch \(-\frac {i \left (60 A \,a^{2} {\mathrm e}^{9 i \left (d x +c \right )}+45 A \,b^{2} {\mathrm e}^{9 i \left (d x +c \right )}+90 B a b \,{\mathrm e}^{9 i \left (d x +c \right )}+120 A \,a^{2} {\mathrm e}^{7 i \left (d x +c \right )}+210 A \,b^{2} {\mathrm e}^{7 i \left (d x +c \right )}+420 B a b \,{\mathrm e}^{7 i \left (d x +c \right )}-480 A a b \,{\mathrm e}^{6 i \left (d x +c \right )}-240 B \,a^{2} {\mathrm e}^{6 i \left (d x +c \right )}-1120 A a b \,{\mathrm e}^{4 i \left (d x +c \right )}-560 B \,a^{2} {\mathrm e}^{4 i \left (d x +c \right )}-640 B \,b^{2} {\mathrm e}^{4 i \left (d x +c \right )}-120 A \,a^{2} {\mathrm e}^{3 i \left (d x +c \right )}-210 A \,b^{2} {\mathrm e}^{3 i \left (d x +c \right )}-420 B a b \,{\mathrm e}^{3 i \left (d x +c \right )}-800 A a b \,{\mathrm e}^{2 i \left (d x +c \right )}-400 B \,a^{2} {\mathrm e}^{2 i \left (d x +c \right )}-320 B \,b^{2} {\mathrm e}^{2 i \left (d x +c \right )}-60 a^{2} A \,{\mathrm e}^{i \left (d x +c \right )}-45 A \,b^{2} {\mathrm e}^{i \left (d x +c \right )}-90 B a b \,{\mathrm e}^{i \left (d x +c \right )}-160 A a b -80 B \,a^{2}-64 b^{2} B \right )}{60 d \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )^{5}}-\frac {\ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right ) A \,a^{2}}{2 d}-\frac {3 \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right ) A \,b^{2}}{8 d}-\frac {3 \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right ) B a b}{4 d}+\frac {\ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right ) A \,a^{2}}{2 d}+\frac {3 \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right ) A \,b^{2}}{8 d}+\frac {3 \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right ) B a b}{4 d}\) \(462\)

[In]

int(sec(d*x+c)^3*(a+b*sec(d*x+c))^2*(A+B*sec(d*x+c)),x,method=_RETURNVERBOSE)

[Out]

(A*b^2+2*B*a*b)/d*(-(-1/4*sec(d*x+c)^3-3/8*sec(d*x+c))*tan(d*x+c)+3/8*ln(sec(d*x+c)+tan(d*x+c)))-(2*A*a*b+B*a^
2)/d*(-2/3-1/3*sec(d*x+c)^2)*tan(d*x+c)+A*a^2/d*(1/2*sec(d*x+c)*tan(d*x+c)+1/2*ln(sec(d*x+c)+tan(d*x+c)))-b^2*
B/d*(-8/15-1/5*sec(d*x+c)^4-4/15*sec(d*x+c)^2)*tan(d*x+c)

Fricas [A] (verification not implemented)

none

Time = 0.30 (sec) , antiderivative size = 208, normalized size of antiderivative = 1.05 \[ \int \sec ^3(c+d x) (a+b \sec (c+d x))^2 (A+B \sec (c+d x)) \, dx=\frac {15 \, {\left (4 \, A a^{2} + 6 \, B a b + 3 \, A b^{2}\right )} \cos \left (d x + c\right )^{5} \log \left (\sin \left (d x + c\right ) + 1\right ) - 15 \, {\left (4 \, A a^{2} + 6 \, B a b + 3 \, A b^{2}\right )} \cos \left (d x + c\right )^{5} \log \left (-\sin \left (d x + c\right ) + 1\right ) + 2 \, {\left (16 \, {\left (5 \, B a^{2} + 10 \, A a b + 4 \, B b^{2}\right )} \cos \left (d x + c\right )^{4} + 15 \, {\left (4 \, A a^{2} + 6 \, B a b + 3 \, A b^{2}\right )} \cos \left (d x + c\right )^{3} + 24 \, B b^{2} + 8 \, {\left (5 \, B a^{2} + 10 \, A a b + 4 \, B b^{2}\right )} \cos \left (d x + c\right )^{2} + 30 \, {\left (2 \, B a b + A b^{2}\right )} \cos \left (d x + c\right )\right )} \sin \left (d x + c\right )}{240 \, d \cos \left (d x + c\right )^{5}} \]

[In]

integrate(sec(d*x+c)^3*(a+b*sec(d*x+c))^2*(A+B*sec(d*x+c)),x, algorithm="fricas")

[Out]

1/240*(15*(4*A*a^2 + 6*B*a*b + 3*A*b^2)*cos(d*x + c)^5*log(sin(d*x + c) + 1) - 15*(4*A*a^2 + 6*B*a*b + 3*A*b^2
)*cos(d*x + c)^5*log(-sin(d*x + c) + 1) + 2*(16*(5*B*a^2 + 10*A*a*b + 4*B*b^2)*cos(d*x + c)^4 + 15*(4*A*a^2 +
6*B*a*b + 3*A*b^2)*cos(d*x + c)^3 + 24*B*b^2 + 8*(5*B*a^2 + 10*A*a*b + 4*B*b^2)*cos(d*x + c)^2 + 30*(2*B*a*b +
 A*b^2)*cos(d*x + c))*sin(d*x + c))/(d*cos(d*x + c)^5)

Sympy [F]

\[ \int \sec ^3(c+d x) (a+b \sec (c+d x))^2 (A+B \sec (c+d x)) \, dx=\int \left (A + B \sec {\left (c + d x \right )}\right ) \left (a + b \sec {\left (c + d x \right )}\right )^{2} \sec ^{3}{\left (c + d x \right )}\, dx \]

[In]

integrate(sec(d*x+c)**3*(a+b*sec(d*x+c))**2*(A+B*sec(d*x+c)),x)

[Out]

Integral((A + B*sec(c + d*x))*(a + b*sec(c + d*x))**2*sec(c + d*x)**3, x)

Maxima [A] (verification not implemented)

none

Time = 0.20 (sec) , antiderivative size = 276, normalized size of antiderivative = 1.39 \[ \int \sec ^3(c+d x) (a+b \sec (c+d x))^2 (A+B \sec (c+d x)) \, dx=\frac {80 \, {\left (\tan \left (d x + c\right )^{3} + 3 \, \tan \left (d x + c\right )\right )} B a^{2} + 160 \, {\left (\tan \left (d x + c\right )^{3} + 3 \, \tan \left (d x + c\right )\right )} A a b + 16 \, {\left (3 \, \tan \left (d x + c\right )^{5} + 10 \, \tan \left (d x + c\right )^{3} + 15 \, \tan \left (d x + c\right )\right )} B b^{2} - 30 \, B a b {\left (\frac {2 \, {\left (3 \, \sin \left (d x + c\right )^{3} - 5 \, \sin \left (d x + c\right )\right )}}{\sin \left (d x + c\right )^{4} - 2 \, \sin \left (d x + c\right )^{2} + 1} - 3 \, \log \left (\sin \left (d x + c\right ) + 1\right ) + 3 \, \log \left (\sin \left (d x + c\right ) - 1\right )\right )} - 15 \, A b^{2} {\left (\frac {2 \, {\left (3 \, \sin \left (d x + c\right )^{3} - 5 \, \sin \left (d x + c\right )\right )}}{\sin \left (d x + c\right )^{4} - 2 \, \sin \left (d x + c\right )^{2} + 1} - 3 \, \log \left (\sin \left (d x + c\right ) + 1\right ) + 3 \, \log \left (\sin \left (d x + c\right ) - 1\right )\right )} - 60 \, A a^{2} {\left (\frac {2 \, \sin \left (d x + c\right )}{\sin \left (d x + c\right )^{2} - 1} - \log \left (\sin \left (d x + c\right ) + 1\right ) + \log \left (\sin \left (d x + c\right ) - 1\right )\right )}}{240 \, d} \]

[In]

integrate(sec(d*x+c)^3*(a+b*sec(d*x+c))^2*(A+B*sec(d*x+c)),x, algorithm="maxima")

[Out]

1/240*(80*(tan(d*x + c)^3 + 3*tan(d*x + c))*B*a^2 + 160*(tan(d*x + c)^3 + 3*tan(d*x + c))*A*a*b + 16*(3*tan(d*
x + c)^5 + 10*tan(d*x + c)^3 + 15*tan(d*x + c))*B*b^2 - 30*B*a*b*(2*(3*sin(d*x + c)^3 - 5*sin(d*x + c))/(sin(d
*x + c)^4 - 2*sin(d*x + c)^2 + 1) - 3*log(sin(d*x + c) + 1) + 3*log(sin(d*x + c) - 1)) - 15*A*b^2*(2*(3*sin(d*
x + c)^3 - 5*sin(d*x + c))/(sin(d*x + c)^4 - 2*sin(d*x + c)^2 + 1) - 3*log(sin(d*x + c) + 1) + 3*log(sin(d*x +
 c) - 1)) - 60*A*a^2*(2*sin(d*x + c)/(sin(d*x + c)^2 - 1) - log(sin(d*x + c) + 1) + log(sin(d*x + c) - 1)))/d

Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 528 vs. \(2 (186) = 372\).

Time = 0.35 (sec) , antiderivative size = 528, normalized size of antiderivative = 2.67 \[ \int \sec ^3(c+d x) (a+b \sec (c+d x))^2 (A+B \sec (c+d x)) \, dx=\frac {15 \, {\left (4 \, A a^{2} + 6 \, B a b + 3 \, A b^{2}\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1 \right |}\right ) - 15 \, {\left (4 \, A a^{2} + 6 \, B a b + 3 \, A b^{2}\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1 \right |}\right ) + \frac {2 \, {\left (60 \, A a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{9} - 120 \, B a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{9} - 240 \, A a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{9} + 150 \, B a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{9} + 75 \, A b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{9} - 120 \, B b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{9} - 120 \, A a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} + 320 \, B a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} + 640 \, A a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} - 60 \, B a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} - 30 \, A b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} + 160 \, B b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} - 400 \, B a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} - 800 \, A a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} - 464 \, B b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 120 \, A a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 320 \, B a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 640 \, A a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 60 \, B a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 30 \, A b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 160 \, B b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 60 \, A a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 120 \, B a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 240 \, A a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 150 \, B a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 75 \, A b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 120 \, B b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )\right )}}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 1\right )}^{5}}}{120 \, d} \]

[In]

integrate(sec(d*x+c)^3*(a+b*sec(d*x+c))^2*(A+B*sec(d*x+c)),x, algorithm="giac")

[Out]

1/120*(15*(4*A*a^2 + 6*B*a*b + 3*A*b^2)*log(abs(tan(1/2*d*x + 1/2*c) + 1)) - 15*(4*A*a^2 + 6*B*a*b + 3*A*b^2)*
log(abs(tan(1/2*d*x + 1/2*c) - 1)) + 2*(60*A*a^2*tan(1/2*d*x + 1/2*c)^9 - 120*B*a^2*tan(1/2*d*x + 1/2*c)^9 - 2
40*A*a*b*tan(1/2*d*x + 1/2*c)^9 + 150*B*a*b*tan(1/2*d*x + 1/2*c)^9 + 75*A*b^2*tan(1/2*d*x + 1/2*c)^9 - 120*B*b
^2*tan(1/2*d*x + 1/2*c)^9 - 120*A*a^2*tan(1/2*d*x + 1/2*c)^7 + 320*B*a^2*tan(1/2*d*x + 1/2*c)^7 + 640*A*a*b*ta
n(1/2*d*x + 1/2*c)^7 - 60*B*a*b*tan(1/2*d*x + 1/2*c)^7 - 30*A*b^2*tan(1/2*d*x + 1/2*c)^7 + 160*B*b^2*tan(1/2*d
*x + 1/2*c)^7 - 400*B*a^2*tan(1/2*d*x + 1/2*c)^5 - 800*A*a*b*tan(1/2*d*x + 1/2*c)^5 - 464*B*b^2*tan(1/2*d*x +
1/2*c)^5 + 120*A*a^2*tan(1/2*d*x + 1/2*c)^3 + 320*B*a^2*tan(1/2*d*x + 1/2*c)^3 + 640*A*a*b*tan(1/2*d*x + 1/2*c
)^3 + 60*B*a*b*tan(1/2*d*x + 1/2*c)^3 + 30*A*b^2*tan(1/2*d*x + 1/2*c)^3 + 160*B*b^2*tan(1/2*d*x + 1/2*c)^3 - 6
0*A*a^2*tan(1/2*d*x + 1/2*c) - 120*B*a^2*tan(1/2*d*x + 1/2*c) - 240*A*a*b*tan(1/2*d*x + 1/2*c) - 150*B*a*b*tan
(1/2*d*x + 1/2*c) - 75*A*b^2*tan(1/2*d*x + 1/2*c) - 120*B*b^2*tan(1/2*d*x + 1/2*c))/(tan(1/2*d*x + 1/2*c)^2 -
1)^5)/d

Mupad [B] (verification not implemented)

Time = 18.35 (sec) , antiderivative size = 359, normalized size of antiderivative = 1.81 \[ \int \sec ^3(c+d x) (a+b \sec (c+d x))^2 (A+B \sec (c+d x)) \, dx=\frac {\mathrm {atanh}\left (\frac {4\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\left (\frac {A\,a^2}{2}+\frac {3\,B\,a\,b}{4}+\frac {3\,A\,b^2}{8}\right )}{2\,A\,a^2+3\,B\,a\,b+\frac {3\,A\,b^2}{2}}\right )\,\left (A\,a^2+\frac {3\,B\,a\,b}{2}+\frac {3\,A\,b^2}{4}\right )}{d}-\frac {\left (2\,B\,a^2-\frac {5\,A\,b^2}{4}-A\,a^2+2\,B\,b^2+4\,A\,a\,b-\frac {5\,B\,a\,b}{2}\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^9+\left (2\,A\,a^2+\frac {A\,b^2}{2}-\frac {16\,B\,a^2}{3}-\frac {8\,B\,b^2}{3}-\frac {32\,A\,a\,b}{3}+B\,a\,b\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^7+\left (\frac {20\,B\,a^2}{3}+\frac {40\,A\,a\,b}{3}+\frac {116\,B\,b^2}{15}\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5+\left (-2\,A\,a^2-\frac {A\,b^2}{2}-\frac {16\,B\,a^2}{3}-\frac {8\,B\,b^2}{3}-\frac {32\,A\,a\,b}{3}-B\,a\,b\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3+\left (A\,a^2+\frac {5\,A\,b^2}{4}+2\,B\,a^2+2\,B\,b^2+4\,A\,a\,b+\frac {5\,B\,a\,b}{2}\right )\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{d\,\left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{10}-5\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^8+10\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6-10\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4+5\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2-1\right )} \]

[In]

int(((A + B/cos(c + d*x))*(a + b/cos(c + d*x))^2)/cos(c + d*x)^3,x)

[Out]

(atanh((4*tan(c/2 + (d*x)/2)*((A*a^2)/2 + (3*A*b^2)/8 + (3*B*a*b)/4))/(2*A*a^2 + (3*A*b^2)/2 + 3*B*a*b))*(A*a^
2 + (3*A*b^2)/4 + (3*B*a*b)/2))/d - (tan(c/2 + (d*x)/2)^5*((20*B*a^2)/3 + (116*B*b^2)/15 + (40*A*a*b)/3) - tan
(c/2 + (d*x)/2)^9*(A*a^2 + (5*A*b^2)/4 - 2*B*a^2 - 2*B*b^2 - 4*A*a*b + (5*B*a*b)/2) - tan(c/2 + (d*x)/2)^3*(2*
A*a^2 + (A*b^2)/2 + (16*B*a^2)/3 + (8*B*b^2)/3 + (32*A*a*b)/3 + B*a*b) + tan(c/2 + (d*x)/2)^7*(2*A*a^2 + (A*b^
2)/2 - (16*B*a^2)/3 - (8*B*b^2)/3 - (32*A*a*b)/3 + B*a*b) + tan(c/2 + (d*x)/2)*(A*a^2 + (5*A*b^2)/4 + 2*B*a^2
+ 2*B*b^2 + 4*A*a*b + (5*B*a*b)/2))/(d*(5*tan(c/2 + (d*x)/2)^2 - 10*tan(c/2 + (d*x)/2)^4 + 10*tan(c/2 + (d*x)/
2)^6 - 5*tan(c/2 + (d*x)/2)^8 + tan(c/2 + (d*x)/2)^10 - 1))